home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
machack
/
Hacks97
/
WarriorsProgress.sit
/
Warrior’s Progress
/
source code
/
Source
/
Libraries
/
Views
/
NumeralView.cp
< prev
next >
Wrap
Text File
|
1997-06-28
|
534b
|
33 lines
// NumeralView.cp
#ifndef NumeralView_h
#include "NumeralView.h"
#endif
NumeralView::NumeralView( ::Face face )
: StringView( face ),
digits( 11 )
{
}
void NumeralView::SetNumber( int32 n )
{
String255 numeral;
NumToString( n, numeral );
SetString( numeral );
}
uint16 NumeralView::MinimumWidth() const
{
String255 string;
string.SetLength( digits );
for ( uint32 i = 0; i < digits; i++ )
string[i] = '0';
return WidthOf( string );
}
uint16 NumeralView::BestWidth() const
{
return MinimumWidth();
}